package com.dldata.devtools30.repository.sysform;


import com.dldata.devtools30.entity.DevtFormFieldcheckEntity;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**

 */
@Repository
public  interface DevtFormFieldCheckDao extends com.dldata.devtools30.repository.BaseRepository<DevtFormFieldcheckEntity,String>,
        JpaSpecificationExecutor<DevtFormFieldcheckEntity> {
    
        @Query("select t from DevtFormFieldcheckEntity t order by t.active")
        public  List<DevtFormFieldcheckEntity> getAllFormFieldCheck();
        
        @Query("select t from DevtFormFieldcheckEntity t where t.name like  ?1 or t.errorinfo like  ?1   order by t.active")
        public  List<DevtFormFieldcheckEntity> getAllFormFieldCheck(String serach);
        
        @Query("select t from DevtFormFieldcheckEntity t where (t.name like  ?1 or t.errorinfo like ?1 )  and t.templeid = ?2")
        public  List<DevtFormFieldcheckEntity> getAllFormFieldCheck(String serach, String templeid);
        
        @Query("select f from DevtFormFieldcheckEntity f where f.templeid = ?1 order by  f.active")
         public  List<DevtFormFieldcheckEntity> getFormFieldCheckByFormId(String templeid);
        
        @Query("select f from DevtFormFieldcheckEntity f where f.templeid = ?1 and f.active=1 order by  f.active")
        public  List<DevtFormFieldcheckEntity> getActieFormFieldCheckByFormId(String templeid);
}
